import { IncomingHttpHeaders } from 'http';

import query from '@dfeidao/atom-nodejs/db/query';

import { systemid,productid } from '../../atom/config';

interface Message {
	filter: {
		question_bank_type: string;
		topic_type:string
	}
	// cookie: {
	// 	uk: string;
	// 	[key: string]: string
	// };
	// urls: {
	// 	base: string;
	// 	origin: string;
	// 	url: string;
	// };
	// query: {};
	// params: {};
	// headers: {};
	// captcha: string;
}



export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders){
	const pre = query(action_id, session_id, systemid);
	pre.prepare('question_bank',['topic'],{productid,question_bank_type:message.filter.question_bank_type,topic_type:message.filter.topic_type},20,1,[],[]);
	const [dt]= await pre.exec();
	return {dt};
}
